<?php
// 分类页面初始化数据
//

$sys = fn_configura($this->website, 'sys');
$json = array('status' => 'ok', 'msg' => '', 'data' => $configura);

$data = $this->website['class']['db']
	->table('type')
	->field('id', 'tit')
	->where('upid=?', $sys['productid'])
	->select();

foreach ($data as &$v) {
	$v['types'] = $this->website['class']['db']
		->table('type')
		->field('id', 'tit')
		->where('upid=?', $v['id'])
		->select();
	foreach ($v['types'] as &$vv) {
		// $vv['image'] = fn_image($this->website, $vv['image']);
		$vv['types'] = $this->website['class']['db']
			->table('type')
			->field('id', 'tit', 'image')
			->where('upid=?', $vv['id'])
			->select();
	}
}

$json['data'] = $data;
$this->json_encode_encrypt($json);
